<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>AdminLTE 2 | Log in</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="statics/vender/bootstrap/css/bootstrap.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="statics/vender/adminlte2/css/AdminLTE.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="statics/vender/adminlte2/plugins/iCheck/square/blue.css">
    
	<meta content="Use Nutz Framework with beetl template engine to build AdminLTE2" name="description" />
	<meta content="elkan1788#gmail.com" name="author" />

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body class="hold-transition login-page">  	
    <div class="login-box" style="display:absoule;">
      <div class="login-logo">
        <a href="#" style="color:#fff"><b>Admin</b>LTE</a>
        <p style="color:#fff">With Nutz & Beetl</p>
      </div><!-- /.login-logo -->
      <div class="login-box-body">
        <p class="login-box-msg">Sign in to start your session</p>
        <form action="#" method="post" data-toggle="validator" onsubmit="return login();">
          <div class="form-group has-feedback">
            <input type="email" id="account" class="form-control" placeholder="Email" required>
            <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
          </div>
          <div class="form-group has-feedback">
            <input type="password" id="password" data-minlength="6" class="form-control" placeholder="Password" required>
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
          </div>
          <div class="row">
            <div class="col-xs-8">
              <div class="checkbox icheck">
                <label>
                  <input type="checkbox"> Remember Me
                </label>
              </div>
            </div><!-- /.col -->
            <div class="col-xs-4">
              <button  id="checkRe" type="submit" class="btn btn-primary btn-block btn-flat">Sign In</button>
            </div><!-- /.col -->
          </div>
        </form>

        <a href="#">I forgot my password</a><br>
        <a href="#" class="text-center">Register a new membership</a>

      </div><!-- /.login-box-body -->
    </div><!-- /.login-box -->

    <!-- jQuery 2.1.4 -->
    <script src="statics/vender/adminlte2/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="statics/vender/bootstrap/js/bootstrap.min.js"></script>
    <!-- iCheck -->
    <script src="statics/vender/adminlte2/plugins/iCheck/icheck.min.js"></script>
    <script>
      $(function () {
        $('input').iCheck({
          checkboxClass: 'icheckbox_square-blue',
          radioClass: 'iradio_square-blue',
          increaseArea: '10%'
        });        
      });
      
      function login(){
    	  $.ajax({
    		  type: 'POST',
    		  url: 'alte2/login/check.ntz',
    		  data: {'account':$('#account').val(),'password':$('#password').val()},
    		  dataType: 'json',
    		  success: function(data){
    			  if (data.id != 0){
    				  window.location.href = data.home;
    			  }
    		  }
    	  });
    	  return false;
      }
    </script>
  </body>
</html>